#include "EntityManager.h"

EntityManager* EntityManager::_instance = NULL;
EntityManager* EntityManager::getInstance()
{
    if(!_instance)
        _instance = new EntityManager;
    return _instance;
}

EntityManager::EntityManager()
:
    _componentMgr(ComponentManager::getInstance()),
    _type(0),
    _currentID(0)
{
    //ctor
}

EntityManager::~EntityManager()
{
    //dtor
}

/*
void EntityManager::addEntity(int type)
{
    _type = type;
    std::vector<Component*> list;
    if(type == tPlayer)
    {
        list.push_back(new PositionComponent());
        list.push_back(new VelocityComponent());
        list.push_back(new HealthComponent());
        list.push_back(new ImageComponent());
        list.push_back(new InputComponent());
    }
    else if(type == tEnemy)
    {

    }
    else if(type == tTile)
    {

    }

    _componentMgr->addEntity()
}
*/
void EntityManager::addEntity(std::vector<Component*> components)
{

    _componentMgr->addEntity(_currentID, components);
}


void EntityManager::deleteEntity(int entity)
{
    _avaliableIDs.push_back(entity);
    _componentMgr->deleteComponents(entity);

}


void EntityManager::setType(int type)
{
    _type = type;
}


int getEntityType()
{
    return _type;
}
